﻿@{
    ViewBag.Title = "EditPhoto";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
}

<div class="padding10">
    <form action="/rdm/addphoto" method="POST" enctype="multipart/form-data">
        <input type="hidden" name="DisputeID" value="@ViewBag.DisputeID"/>
        <input type="hidden" name="action" value="EditPhoto" />
        <div class="row-fluid">
            <div class="span3">Image</div>
            <div class="span9">
                <input type="file" name="image" required="required" />
            </div>
        </div>
        <div class="row-fluid">
            <div class="span3">Description</div>
            <div class="span9">
                <textarea name="Description" class="input-block-level"></textarea>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span3"></div>
            <div class="span9"><input type="submit" class="btn btn-primary" value="Upload"></div>
        </div>
    </form>
    <table class="table table-hover table-bordered table-fix">
        <thead>
            <tr>
                <th>Image</th>
                <th>Name</th>
                <th>Description</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        <img src="/rdm/getfile?path=@item.Path" style="width: 80px; height: 60px" alt="@item.Name" /></td>
                    <td>@item.Name</td>
                    <td>@item.Description</td>
                    <td><a href="/rdm/deletedisputephoto/@item.PhotoID?url=EditPhoto" onclick="javascript:return confirm('Are you sure?');">Delete</a></td>
                </tr>
            }
        </tbody>
    </table>
</div>
